package jdbc.view;

import jdbc.controller.UserController;
import jdbc.entity.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.text.ParseException;

/**
 * Author：汤小洋
 * Date：2022-11-23 16:04
 * Description：<描述>
 */
public class Test {
    public static void main(String[] args) throws ParseException {

        ApplicationContext ac = new ClassPathXmlApplicationContext("jdbc/spring.xml");
        UserController userController = (UserController) ac.getBean("userController");

        User u = new User();
        u.setUsername("ddd");
        u.setPassword("123");
        userController.register(u);
        System.out.println("注册成功！");

        // User user = userController.login("aaa", "1");
        // if(user != null){
        //     System.out.println("登陆成功");
        // }else{
        //     System.out.println("登陆失败");
        // }


    }
}
